home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / prog / pas_all.zip / TI457.ASC < prev    next >
Text File  |  1991-09-11  |  6KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  457
  9.   VERSION  :  4.0
  10.        OS  :  PC-DOS
  11.      DATE  :  January 3, 1990                          PAGE  :  1/4
  12.  
  13.     TITLE  :  LINKING ERROR.MSG AND FONT FILES
  14.  
  15.  
  16.  
  17.  
  18.   This technical information  handout  describes how to link in the
  19.   ERROR.MSG, 4x6.FON, 8x8.FON and 14x9.FON  files  into  your *.EXE
  20.   file so that your  application  no longer needs these files to be
  21.   present  on  disk.   Please make these changes to  copies of your
  22.   Turbo Pascal Graphix Toolbox  4.0  files,  in case something goes
  23.   wrong.  The following files will be affected:
  24.  
  25.   GRAF3270.DVR   GRAFEGA.DVR  ERROR.MSG   14X9.FON
  26.   GRAFATT.DVR    GRAFHGC.DVR  4X6.FON     GDRIVER.PAS
  27.   GRAFCGA.DVR    GKERNEL.PAS  8X8.FON
  28.  
  29.  
  30.   First, you must  convert  the  ERROR.MSG,  4x6.FON,  8x8.FON, and
  31.   14x9.FON files to  the OBJ format.
  32.  
  33.   Use  the BINOBJ.EXE utility to convert these  files  to  the  OBJ
  34.   format.
  35.  
  36.   For example,
  37.  
  38.           BINOBJ ERROR.MSG ERROR.OBJ FakeErr <Return>
  39.           BINOBJ 4x6.FON  4x6.OBJ Font4x6 <Return>
  40.           BINOBJ 8x8.FON  8x8.OBJ FakeFont <Return>
  41.           BINOBJ 14x9.FON  14x9.OBJ FakeFont <Return>
  42.  
  43.  
  44.   Next, delete the  first  13  lines  of  code  from  the procedure
  45.   EnterGraphic in each of the  *.DVR and GDRIVER.PAS files with the
  46.   exception of GRAFATT.DVR  file.   In the GRAFATT.DVR file, delete
  47.   the first 15 lines of code instead. Also, in the GRAFCGA.DVR file
  48.   substitute  the  line  below  "{$L  14x9  }"    with "{$L 8x8 }".
  49.   Replace the deleted lines with the following code:
  50.  
  51.  
  52.  
  53.   {$L 14x9}       { ADD }
  54.   procedure FakeFont; external;   { ADD }
  55.  
  56.   procedure EnterGraphic;
  57.   { Enter graphics mode }
  58.   ...
  59.   ...
  60.   begin
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  457
  75.   VERSION  :  4.0
  76.        OS  :  PC-DOS
  77.      DATE  :  January 3, 1990                          PAGE  :  2/4
  78.  
  79.     TITLE  :  LINKING ERROR.MSG AND FONT FILES
  80.  
  81.  
  82.  
  83.  
  84.    if not FontLoaded then   { ADD }
  85.     begin                   { ADD }
  86.       Move(Mem[Seg(FakeFont):Ofs(FakeFont)], Font, SizeOf(Font));
  87.                                {ADD}
  88.        FontLoaded := true;     { ADD }
  89.     end;                       { ADD }
  90.   ....
  91.   .....
  92.   The rest of the EnterGraphic procedure remains the same.
  93.  
  94.  
  95.   The following changes should be made in the GKERNEL.PAS unit:
  96.  
  97.   {$L 4x6 }                                          {NEW}
  98.   procedure Font4x6; external;                       {NEW}
  99.  
  100.   {$L Error}                                         {NEW}
  101.   procedure FakeErr; external;                       {NEW}
  102.  
  103.   procedure InitGraphic;
  104.   var
  105.     Fil : file of CharArray;
  106.     Tfile : text;
  107.     Test : ^integer;
  108.     Temp : WrkString;
  109.     I : word;
  110.     GTBCount : integer;                              {NEW}
  111.     GTBch    : char;                                 {NEW}
  112.  
  113.     Function ErrorStr : WrkString;                   {NEW}
  114.     begin                                            {NEW}
  115.       temp := '';                                    {NEW}
  116.       repeat                                         {NEW}
  117.         GTBch := chr(mem[Seg(FakeErr):Ofs(FakeErr) + GTBcount]);
  118.         if not ((GTBch = #10) or (GTBch = #13)) then {NEW}
  119.           temp := temp + GTBch;                      {NEW}
  120.         inc(GTBcount);                               {NEW}
  121.       until(GTBch = #13);                            {NEW}
  122.       ErrorStr := temp;                              {NEW}
  123.     end; { Function ErrorStr }                       {NEW}
  124.  
  125.   begin
  126.     MessageGlb := true;
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  457
  141.   VERSION  :  4.0
  142.        OS  :  PC-DOS
  143.      DATE  :  January 3, 1990                          PAGE  :  3/4
  144.  
  145.     TITLE  :  LINKING ERROR.MSG AND FONT FILES
  146.  
  147.  
  148.  
  149.  
  150.     BrkGlb := false;
  151.     GrafModeGlb := false;
  152.     GotoXY(1, 1);
  153.     if not HardwarePresent then
  154.     begin
  155.       ClrScr;
  156.       GotoXY(1, 2);
  157.       WriteLn('Fatal  Error:  graphics hardware not  found  or  not
  158.   properly activated');
  159.       Halt;
  160.     end;
  161.     GetMem(ErrorProc[0], 16);
  162.     GetMem(ErrorCode[0], 24);
  163.     ErrorProc[0]^ := 'InitGraphic';
  164.     ErrorCode[0]^ := 'Error.MSG missing';
  165.     GTBcount := 0;                                   {NEW}
  166.     for I := 0 to MaxProcsGlb do                {MODIFIED}
  167.       begin
  168.         Temp := ErrorStr;                            {NEW}
  169.         if I <> 0 then
  170.           GetMem(ErrorProc[I], Length(Temp) + 1);
  171.         ErrorProc[I]^ := Temp;
  172.       end;
  173.     for I := 0 to MaxErrsGlb do                 {MODIFIED}
  174.       begin
  175.         Temp := ErrorStr;                            {NEW}
  176.         if I <> 0 then
  177.           GetMem(ErrorCode[I], Length(Temp) + 1);
  178.         ErrorCode[I]^ := Temp;
  179.       end;
  180.     PcGlb := ErrorStr;                          {MODIFIED}
  181.     for I := 1 to MaxWorldsGlb do
  182.       DefineWorld(I, 0, 0, XScreenMaxGlb, YMaxGlb);
  183.     MaxWorldGlb := 1;
  184.     for I := 1 to MaxWindowsGlb do
  185.     begin
  186.       DefineWindow(I, 0, 0, XMaxGlb, YMaxGlb);
  187.       with Stack[I] do
  188.       begin
  189.         W.Size := 0;
  190.         Contents := nil;
  191.       end;
  192.     end;
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.   PRODUCT  :  TURBO PASCAL GRAPHIX TOOLBOX           NUMBER  :  457
  207.   VERSION  :  4.0
  208.        OS  :  PC-DOS
  209.      DATE  :  January 3, 1990                          PAGE  :  4/4
  210.  
  211.     TITLE  :  LINKING ERROR.MSG AND FONT FILES
  212.  
  213.  
  214.  
  215.  
  216.     MaxWindowGlb := 1;
  217.     Move(mem[seg(Font4x6):ofs(Font4x6)],CharSet,Sizeof(CharSet));
  218.     {NEW}
  219.  
  220.     Delete the next 12 lines of code.
  221.  
  222.     The rest of the code remains the same in the GKERNEL.PAS unit.
  223.     BrkGlb := True;
  224.     If RamScreenGlb Then
  225.     ...
  226.     ...
  227.  
  228.   ****************************************************************
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.